package calendar.commands.event;

import calendar.commands.CalendarCommand;
import com.google.api.services.calendar.model.Events;

import static calendar.model.CalendarModel.EVENTS;

public class ReadEvents extends CalendarCommand {
    public ReadEvents(com.google.api.services.calendar.Calendar client) {
        super(client);
    }

    @Override
    protected void protectedExecute() throws Exception {
        Events feed = client.events().list(calendar.getId()).execute();
        EVENTS.notifyObservers(feed);
    }
}
